import request from '@/utils/request'
/**
 *获取推荐频道文章推荐列表
 * @param {*} id 频道的Id
 * @param {*} timestamp 时间戳
 * @returns
 */
export const GetArticleList = (id, timestamp) => {
  return request({
    method: 'get',
    url: '/v1_0/articles',
    params: { channel_id: id, timestamp: timestamp }
  })
}
export const reqReportArticle = (ArticleId, TypeId) => {
  return request({
    method: 'post',
    url: '/v1_0/article/reports',
    data: {
      target: ArticleId,
      type: TypeId
    }
  })
}
/**
 * 文章详情
 * @param {*} articleId  文章Id
 * @returns
 */
export const reqArticleDesc = (articleId) => {
  return request({
    method: 'get',
    url: `/v1_0/articles/${articleId}`
  })
}
export const reqAuthorLike = (authorId) => {
  return request({
    method: 'post',
    url: '/v1_0/user/followings',
    data: {
      target: authorId
    }
  })
}

export const reqAuthorDisLike = (authorId) => {
  return request({
    method: 'delete',
    url: '/v1_0/user/followings/' + authorId
  })
}
export const reqArticleCollected = (articleId) => {
  return request({
    method: 'post',
    url: '/v1_0/article/likings',
    data: {
      target: articleId
    }
  })
}
export const reqDelArticleCollected = (articleId) => {
  return request({
    method: 'delete',
    url: '/v1_0/article/likings/' + articleId

  })
}

export const reqArticleDisLike = (articleId) => {
  return request({
    method: 'post',
    url: '/v1_0/article/dislikes',
    data: {
      target: articleId
    }
  })
}
export const reqDelArticleDisLike = (articleId) => {
  return request({
    method: 'delete',
    url: '/v1_0/article/dislikes/' + articleId

  })
}
